<?php


namespace App\Http\Controllers\applets\api;


use App\Http\Controllers\applets\service\SnService;
use App\Http\Controllers\applets\validate\Sn;
use App\Http\Controllers\utils\ToolUtil;
use Illuminate\Http\Request;

class SnApi
{
    public function getBrowserUrlInfo(Request $request){
        $param = $request->all();
        $data = Sn::getBrowserUrlInfo($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::getBrowserUrlInfo($param);
    }

    public function addBrowser(Request $request){
        $param = $request->all();
        $data = Sn::addBrowser($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::addBrowser($param);
    }

    public function editBrowser(Request $request){
        $param = $request->all();
        $data = Sn::editBrowser($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::editBrowser($param);
    }

    public function deleteBrowser(Request $request){
        $param = $request->all();
        $data = Sn::deleteBrowser($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::deleteBrowser($param);
    }

    public function getBrowser(Request $request){
        $param = $request->all();
        $data = Sn::getBrowser($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::getBrowser($param);
    }

    public function getSetting(Request $request){
        $param = $request->all();
        $data = Sn::getSetting($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::getSetting($param);
    }

    public function editSetting(Request $request){
        $param = $request->all();
        $data = Sn::editSetting($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::editSetting($param);
    }

    public function getAppAll(Request $request){
        $param = $request->all();
        $data = Sn::getAppInstall($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::getAppAll($param);
    }

    public function appUninstall(Request $request){
        $param = $request->all();
        $data = Sn::appUninstall($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::appUninstall($param);
    }

    public function editAppInstall(Request $request){
        $param = $request->all();
        $data = Sn::editAppInstall($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::editAppInstall($param);
    }

    public function querySnGrade(){
        return SnService::querySnGrade();
    }

    public function querySnIdScreenshot(Request $request){
        $param = $request->all();
        $data = Sn::querySnIdScreenshot($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::querySnIdScreenshot($param);
    }

    public function sendScreenshot(Request $request){
        $param = $request->all();
        $data = Sn::sendScreenshot($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::sendScreenshot($param);
    }

    public function screenIsLock(Request $request){
        $param = $request->all();
        $data = Sn::screenIsLock($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::screenIsLock($param);
    }

    public function queryTimeControl(Request $request){
        $param = $request->all();
        $data = Sn::queryTimeControl($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::queryTimeControl($param);
    }

    public function addTimeControl(Request $request){
        $param = $request->all();
        $data = Sn::addTimeControl($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::addTimeControl($param);
    }

    public function updateTimeControl(Request $request){
        $param = $request->all();
        $data = Sn::updateTimeControl($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::updateTimeControl($param);
    }

    public function deleteTimeControl(Request $request){
        $param = $request->all();
        $data = Sn::deleteTimeControl($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::deleteTimeControl($param);
    }

    public function deleteScreenshot(Request $request){
        $param = $request->all();
        $data = Sn::deleteScreenshot($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::deleteScreenshot($param);
    }

    public function longRangeControl(Request $request){
        $param = $request->all();
        $data = Sn::longRangeControl($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return SnService::longRangeControl($param);
    }


    
}